package com.chat.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.chat.dao.YzbChatMsgMapper;
import com.chat.service.ChatMessageService;
import com.chat.vo.YzbChatMsg;
@Service("chatService")
@Transactional
public class ChatMessageServiceImpl implements ChatMessageService{

	@Resource
	private YzbChatMsgMapper yzbChatMsgMapper; 
	
	@Override
	public boolean saveChatMessage(YzbChatMsg yzbChatMsg) {
		
		boolean result = true;
		int resultClm = yzbChatMsgMapper.insertChatRecord(yzbChatMsg);
		
		if (resultClm == 0)
		{
			result = false;
		}
		return result;
	}

	@Override
	public List<YzbChatMsg> queryMessageForCondition(YzbChatMsg condition) {
		// TODO Auto-generated method stub
		List<YzbChatMsg> chatMsgList = yzbChatMsgMapper.selectByPrimaryKey(condition);
		
		return chatMsgList;
	}
	
}
